<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%><%@ taglib prefix="s" uri="/struts-tags" %> <%String path = request.getContextPath();String basePath = request.getScheme() + "://"+ request.getServerName() + ":" + request.getServerPort()+ path + "/";%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<base href="<%=basePath%>">
		<title>User Register</title>
		<!--<link rel="stylesheet" type="text/css" href="styles.css">-->
		<link rel="stylesheet" type="text/css" href="css/jquery-themes/jquery.ui.all.css" />
	    <style type="text/css">
	    	*{font-size:12px;}
	    	.lgipt{width:160px;}
			#email_list {width:160px;padding:0px 2px;margin:0px;list-style:none;border:1px solid #74c9e6; -moz-border-radius:0 0 2px 2px; border-radius:2px;position:absolute;top:0px;left:0px; background:#fff;display:none; }
			#email_list li {width:100%; height:21px;  line-height:21px; text-indent:0px; cursor:pointer; overflow:hidden; }
			#email_list li.first_li { cursor:default; }
			#email_list .current { background:#baeafb; }
			#pwdInfo{width:100px;height:13px;display:block;background:url("img/pwdstrength.gif") no-repeat 0px 0px;}
	    	
	    	/* datepicker */
	    	.ui-datepicker{width:14em;}
	    	.ui-widget{font-family:Verdana;}
	    	.ui-datepicker select.ui-datepicker-month, .ui-datepicker select.ui-datepicker-year{width:auto; }
	    </style>
	    
		<script type="text/javascript" src="js/jquery.js"></script>
		<script type="text/javascript" src="js/jquery.form.js"></script>
		<script type="text/javascript" src="js/country.js"></script>
	    <script type="text/javascript" src="js/datepicker/jquery.ui.core.js"></script>
	    <script type="text/javascript" src="js/datepicker/jquery.ui.widget.js"></script>
	    <script type="text/javascript" src="js/datepicker/i18n/jquery.ui.datepicker-zh-CN.js"></script>
	    <script type="text/javascript" src="js/datepicker/jquery.ui.datepicker.js"></script>
	    <script type="text/javascript" src="js/autoEmail.js"></script>
	    <script type="text/javascript" src="js/passwordStrength.js"></script>
		<script type="text/javascript">
			$(function(){
				var now=new Date();
				$("#birthday").datepicker({changeMonth: true,changeYear: true,maxDate:"-1d"});
			    setSelectCountry($("#country"),"cn");
			    $("#automail").mail({emailListId:"email_list",checkedClass:"current"});
			    $("#password").passwordStrength({powerful:function(){
			    		$("#pwdInfo").css("background-position","0px -26px");
				    },middling:function(){
				    	$("#pwdInfo").css("background-position","0px -13px");
				    },weak:function(){
			    		$("#pwdInfo").css("background-position","0px 0px");
			    }});
			    $("#registerForm").ajaxForm({beforeSubmit:validate,success:showResponse});
			});
			
			function validate(formData, jqForm, options){
				alert("提交 脚本通过");
				return true;
			}
			function showResponse(responseText, statusText, xhr, $form){
				alert(responseText);
			}
		</script>
	</head>

	<body>
	<s:debug></s:debug>
	<s:fielderror fieldName="name"></s:fielderror>
		<form id="registerForm" action="registerIn" method="post">
		<table>
			<tr><th colspan="3">用户注册</th></tr>
			<tr>
				<td>用户名:</td>
				<td><input type="text" name="user.name" class="lgipt" maxlength="20" /></td>
				<td></td>
			</tr>
			<tr>
				<td>密码:</td>
				<td><input id="password" type="password" class="lgipt" name="user.password" /></td>
				<td><span id="pwdInfo"></span></td>
			</tr>
			<tr>
				<td>确认密码:</td>
				<td><input type="password" name="password" class="lgipt" /></td>
				<td></td>
			</tr>
			<tr>
				<td>生日:</td>
				<td><input id="birthday" readonly="readonly" class="lgipt" type="text" name="user.birthday" /></td>
				<td></td>
			</tr>
			<tr>
				<td>邮箱:</td>
				<td>
					<input id="automail" type="text" name="user.email" class="lgipt" autocomplete="off" />
					<div style="position:relative;">
					<ul id="email_list">
					    <li>请选择邮箱类型</li>
					    <li></li>
					    <li>@163.com</li>
					    <li>@126.com</li>
					    <li>@qq.com</li>
					    <li>@yahoo.com.cn</li>
					    <li>@gmail.com</li>
					    <li>@sohu.com</li>
					    <li>@hotmail.com</li>
					  </ul>
					  </div>
				</td>
				<td></td>
			</tr>
			<tr>
				<td>国籍:</td>
				<td>
					<select id="country" name="user.nationality" style="width:165px;">
						<option>--请选择国籍--</option>
					</select>
				</td>
				<td></td>
			</tr>
			<tr>
				<td>验证码:</td>
				<td>
					<input type="text" style="width:60px;" maxlength="4" /><img align="middle" src="code/image.html" />
				</td>
				<td></td>
			</tr>
			<tr align="center"><td colspan="3"><input type="submit"" value="注册" /></td></tr>
		</table>
		</form>
	</body>
</html>
